﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
 
using System.Xml.Linq;

 
using System.Data.SqlClient;
using System.Collections;

using EBAYVN.DAO;
using EBAYVN.Util;


public class ReportClass
{
	public ReportClass()
	{
		
	}
    public String GetNgayThangNam()
    {
        return String.Format("TP.Hồ Chí Minh, Ngày {0} tháng {1} năm {2}", DateTime.Now.Day, DateTime.Now.Month, DateTime.Now.Year);
    }
    public DataSet PhuongTien() 
    {
        Database db = new Database();
        DataSet ds = db.RunExecProc("DM_PHUONGTIEN");
        db.Dispose();
        return ds;
    }
    public DataSet NhanVien(string macv)
    {
        Database db = new Database();
        SqlParameter[] prams = {
                    db.MakeInParam("@MACV", SqlDbType.VarChar  , 10, macv)
                               };
        DataSet ds = db.RunExecProc("DM_NHANVIEN",prams);
        db.Dispose();
        return ds;
    }
    
    public DataSet LoaiHangHoa()
    {
        Database db = new Database();
        DataSet ds = db.RunExecProc("DM_lOAIHANGHOA");
        db.Dispose();
        return ds;
    }
    public DataSet NV_DANHSACHLICHTRINH(DateTime tuNgay, DateTime denNgay, string tinhtrang)
    {
        Database db = new Database();
        SqlParameter[] prams = {
                    db.MakeInParam("@TUNGAY", SqlDbType.DateTime  , 8, tuNgay),
                    db.MakeInParam("@DENNGAY", SqlDbType.DateTime  , 8, denNgay),
                    db.MakeInParam("@TINHTRANG", SqlDbType.VarChar  , 10, tinhtrang)
                               };
        DataSet ds = db.RunExecProc("NV_DANHSACHLICHTRINH", prams);
        db.Dispose();
        return ds;
    }
    public DataSet NV_DANHSACHHOPDONG(DateTime tuNgay, DateTime denNgay, string tinhtrang)
    {
        Database db = new Database();
        SqlParameter[] prams = {
                    db.MakeInParam("@TUNGAY", SqlDbType.DateTime  , 8, tuNgay),
                    db.MakeInParam("@DENNGAY", SqlDbType.DateTime  , 8, denNgay),
                    db.MakeInParam("@TINHTRANG", SqlDbType.VarChar  , 10, tinhtrang)
                               };
        DataSet ds = db.RunExecProc("NV_DANHSACHHOPDONG", prams);
        db.Dispose();
        return ds;
    }
    public DataSet NV_BANGTHUCHITIETCUHOPDONG(DateTime tuNgay, DateTime denNgay, string MAHD)
    {
        Database db = new Database();
        SqlParameter[] prams = {
                    db.MakeInParam("@TUNGAY", SqlDbType.DateTime  , 8, tuNgay),
                    db.MakeInParam("@DENNGAY", SqlDbType.DateTime  , 8, denNgay),
                    db.MakeInParam("@MAHD", SqlDbType.VarChar  , 10, MAHD)
                               };
        DataSet ds = db.RunExecProc("NV_BANGTHUCHITIETCUHOPDONG", prams);
        db.Dispose();
        return ds;
    }
    public DataSet NV_DANHSACHHOPDONGCHUATHANHTOAN(DateTime tuNgay, DateTime denNgay, string tinhtrang)
    {
        Database db = new Database();
        SqlParameter[] prams = {
                    db.MakeInParam("@TUNGAY", SqlDbType.DateTime  , 8, tuNgay),
                    db.MakeInParam("@DENNGAY", SqlDbType.DateTime  , 8, denNgay),
                    db.MakeInParam("@TINHTRANG", SqlDbType.VarChar  , 10, tinhtrang)
                               };
        DataSet ds = db.RunExecProc("NV_DANHSACHHOPDONGCHUATHANHTOAN", prams);
        db.Dispose();
        return ds;
    }
    public DataSet NV_DANHSACHDONDANGKI(DateTime tuNgay, DateTime denNgay, string tinhtrang)
    {
        Database db = new Database();
        SqlParameter[] prams = {
                    db.MakeInParam("@TUNGAY", SqlDbType.DateTime  , 8, tuNgay),
                    db.MakeInParam("@DENNGAY", SqlDbType.DateTime  , 8, denNgay),
                    db.MakeInParam("@TINHTRANG", SqlDbType.VarChar  , 10, tinhtrang)
                               };
        DataSet ds = db.RunExecProc("NV_DANHSACHDONDANGKI", prams);
        db.Dispose();
        return ds;
    }
}
   
